package com.xuecheng.order.controller;

import com.xuecheng.commons.model.vo.ResponseResult;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xuecheng.order.service.OrdersService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 订单前端控制器
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
public class OrdersController {

    @Autowired
    private OrdersService  ordersService;
    @PostMapping("/orders/create/{coursePubId}")
    public ResponseResult createOrder(@PathVariable("coursePubId")long coursePubId){
        return ordersService.createOrder(coursePubId);

    }

}
